home *** CD-ROM | disk | FTP | other *** search
- on wait nTicks
- set endTime to the ticks + nTicks
- repeat while the ticks < endTime
- end repeat
- end
-
- on PressButton
- set chButton to the clickOn
- set castNumButtonUp to the castNum of sprite chButton
- set btnUpName to the name of cast castNumButtonUp
- set nWordsInName to the number of words in btnUpName
- if nWordsInName > 1 then
- if word 2 of btnUpName = "Gray" then
- return 0
- end if
- end if
- if nWordsInName = 1 then
- set castNumButtonDown to castNumButtonUp + 1
- else
- set castNumBase to the number of member word 1 of btnUpName
- set castNumButtonDown to castNumBase + 1
- end if
- set downFlag to 1
- repeat while downFlag
- if rollOver(chButton) then
- set the castNum of sprite chButton to castNumButtonDown
- else
- set the castNum of sprite chButton to castNumButtonUp
- end if
- updateStage()
- set downFlag to the stillDown
- end repeat
- set the castNum of sprite chButton to castNumButtonUp
- updateStage()
- if rollOver(chButton) then
- return 1
- else
- set the castNum of sprite chButton to castNumButtonUp
- return 0
- end if
- end
-
- on PressCheckBox
- set chCheckBox to the clickOn
- set castNumCheckBoxUp to the castNum of sprite chCheckBox
- set checkBoxUpName to the name of cast castNumCheckBoxUp
- set nWordsInName to the number of words in checkBoxUpName
- if nWordsInName > 1 then
- if word 2 of checkBoxUpName = "Gray" then
- return 0
- end if
- end if
- set castNumCheckBoxDown to castNumCheckBoxUp + 1
- set downFlag to 1
- repeat while downFlag
- if rollOver(chCheckBox) then
- set the castNum of sprite chCheckBox to castNumCheckBoxDown
- else
- set the castNum of sprite chCheckBox to castNumCheckBoxUp
- end if
- updateStage()
- set downFlag to the stillDown
- end repeat
- if rollOver(chCheckBox) then
- return 1
- else
- set the castNum of sprite chCheckBox to castNumCheckBoxUp
- return 0
- end if
- end
-
- on IncrMod theCurrentValue, theMaxValue
- if theCurrentValue = theMaxValue then
- return 1
- else
- return theCurrentValue + 1
- end if
- end
-
- on DecrMod theCurrentValue, theMaxValue
- if theCurrentValue = 1 then
- return theMaxValue
- else
- return theCurrentValue - 1
- end if
- end
-
- on HitWhoH spriteNum, theMax
- set theRealWidth to the right of sprite spriteNum - the left of sprite spriteNum
- set who to ((the mouseH - the left of sprite spriteNum) * theMax / theRealWidth) + 1
- if who <= 1 then
- set who to 1
- end if
- if who > theMax then
- set who to theMax
- end if
- return who
- end
-
- on round n
- return integer(n + 0.49000000000000005)
- end
-